package com.example.mapper;

import com.example.pojo.entity.Collect;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 本文来演示
 *
 * @author 赵建云
 * @create 2023/10/10
 */
public interface CollectMapper {
    @Insert("insert into collect(js_id,pos_id) values(#{jsId},#{posId})")
    int collectSave(@Param("jsId") Integer jsId,@Param("posId") Integer posId);
    @Delete("delete from collect where js_id = #{jsId} and pos_id = #{posId}")
    int collectDelete(@Param("jsId")Integer jsId,@Param("posId") Integer posId);
    @Select("select pos_id from collect where js_id = #{value}")
    List<Integer> collectByJsId(Integer jsId);
    @Select("select * from collect where js_id=#{jsId} and pos_id=#{posId}")
    Collect searchCollect(@Param("jsId") Integer jsId,@Param("posId") Integer posId);
    @Select("select count(js_id) from collect where js_id = #{value}")
    int collectNumById(Integer jsId);

}
